package com.bwie.system.controller;

import com.bwie.common.domain.response.UserInfo;
import com.bwie.common.result.Result;
import com.bwie.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户控制层
 *
 * @author <a href="mailto:2891704036@qq.com">zhiyuheng</a>
 * @version 1.0
 * @description: 用户控制层
 * @date 2025/9/9 9:30
 */
@RestController
public class SysUserController {

    /**
     * 用户业务处理层
     */
    @Autowired
    private SysUserService sysUserService;

    /**
     * 根据手机号查询用户信息
     * @param phone
     * @return
     */
    @GetMapping("findByPhone/{phone}")
    public Result<UserInfo> findByPhone(@PathVariable("phone") String phone){
        return Result.success(sysUserService.findByPhone(phone));
    }
}
